package com.bilgeadam.patterns.singleton.program;

/**
 *
 * @author Bora SAYINER
 * @since Dec 28, 2014 10:14:41 AM
 * @version 1.0
 */
public class DBSingleton {

	private static DBSingleton INSTANCE;

	// Eager loading
	static {
		INSTANCE = new DBSingleton();
	}

	private DBSingleton() {
	}

	public static DBSingleton getInstance() {
		// Lazy loading
		// if (INSTANCE == null) {
		// INSTANCE = new DBSingleton();
		// }
		return INSTANCE;
	}

	public void openConnection() {
		System.out.println("VT bağlantısı açıldı.");
	}

	public void closeConnection() {
		System.out.println("VT bağlantısı kapatıldı.");
	}
}
